package com.wanxi.web.controller;

import com.wanxi.domain.code.ResultCode;
import com.wanxi.domain.vo.OrderQueryVO;
import com.wanxi.domain.vo.OrderVO;
import com.wanxi.domain.vo.Paging;
import com.wanxi.orderApi.OrderFeign;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

/**
 * ClassName: ShopOrderController
 * Description: 商店订单
 *
 * date: 2022/1/17 9:23
 *
 * @author lxl
 * @version 1.0
 * @since JDK 1.8
 */
@Api(tags = "店家订单接口")
public class ShopOrderController {
    @Autowired
    private OrderFeign orderFeign;

    /**
     * 发货
     *
     * @param orderId 订单id
     * @return 是否成功
     */
    @PutMapping("/order/orderApi/send/{orderId}")
    ResultCode send(@PathVariable long orderId){
        return orderFeign.send(orderId);
    }


    /**
     * 企业获得自己所有门店的所有订单
     *
     * @param vo 查询条件，必须传入企业id
     * @return 企业订单列表
     */
    @GetMapping("/order/orderApi/enterprise/getOrdersByShopId/")
    List<OrderVO> getOrdersByShopId(OrderQueryVO vo){
        return orderFeign.getShopOrdersById(vo);
    }



}
